<!DOCTYPE html>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<style>
input {
  position: absolute;
  top: 0;
  left: 0;
  height: 50px;
  width: 200px;
}
</style>
<div>This change checks that the caret in the &gt;input&lt; below doesn't shift out of it after several layouts.</div>
<div>This test has passed if the caret is centered <b>inside</b> the &gt;input&lt;</div>
<input id="input" type="text" autofocus>
<script>
if (window.testRunner)
    testRunner.waitUntilDone();
runAfterLayoutAndPaint(function() {
  input.style.left = '10px';
  runAfterLayoutAndPaint(function() {
    input.style.left = '20px';
    runAfterLayoutAndPaint(function() {
      input.style.left = '30px';
    }, true);
  });
});
</script>
